#!/bin/sh

case $1 in
    g22)
	export JAVA_HOME=~/app/graal/graalvm-jdk-22.0.2+9.1
	;;
    *)
	if [ -z $1 ]
	   then
	       export JAVA_HOME=/usr/lib/jvm/default
	else
	    export JAVA_HOME=/usr/lib/jvm/java-$1-openjdk
	fi
	;;
esac

export PATH=$JAVA_HOME/bin:$PATH
echo "java:    "$JAVA_HOME" | "$(java --version | grep "jdk")
